package com.springboot.stelleroid;

import com.qax.task.timer.core.JobHanlder;
import com.qax.task.timer.core.JobStatus;

/**
 * @author lianglei
 */
public class EmailJob {

    @JobHanlder(
            type = "jcq",
            applicationName ="email-application")
    public Integer  sendEmail(){
        System.out.println("send email !!!!\t");
        return 1 ;
    }

    public static void main(String[] args) throws Exception {
//        Main.etcdClient.putKey("/jcq/email-application/GROUP_NAME/034d5050/command/", "{ \t\"jobId\" : \"034d5050-6d88-4da6-86f4-3e966e359a1c\", \t\"executorFailRetryCount\" :\"3\", \t\"triggerTime\":\"1000\", \t\"triggerMsg\":\"hello\" }");
//        CompletableFuture.runAsync(()->{System.out.println(1212121);});
//        Thread.sleep(5000);

//        Main.etcdClient.putKey("/jcq/email-application/GROUP_NAME/034d5050-6d88-4da6-86f4-3e966e359a1c/command/","{ \t\"jobId\" : \"034d5050-6d88-4da6-86f4-3e966e359a1c\", \t\"executorFailRetryCount\" :\"3\", \t\"triggerTime\":\"2000\", \t\"triggerMsg\":\"hello1\" }");
//        String s = new String(Main.etcdClient.getKey("/jcq/email-application/GROUP_NAME/034d5050/status/").getValue().getBytes());
//        System.out.println(s);
//        Main.etcdClient.putKey("/jcq/email-application/GROUP_NAME/034d5050/status/", JobStatus.RUN.toString());

    }
}
